import request from '@/utils/request'

export default {
  getPoints() {
    return request({
      url: '/points',
      method: 'GET'
    })
  },
  
  getTasks() {
    return request({
      url: '/points/tasks',
      method: 'GET'
    })
  },
  
  completeTask(taskId) {
    return request({
      url: `/points/tasks/${taskId}/complete`,
      method: 'POST'
    })
  },
  
  getHistory(params = {}) {
    return request({
      url: '/points/history',
      method: 'GET',
      data: params
    })
  },
  
  createCustomTask(data) {
    return request({
      url: '/points/custom-tasks',
      method: 'POST',
      data
    })
  },
  
  getLevelInfo() {
    return request({
      url: '/points/level',
      method: 'GET'
    })
  }
}